//标准的JavaBean类写某个用户的注册页面
class User {
    private String username;
    private String password;
    private String email;
    public String gender;
    private int age;

    public User() {
    }

    public User(String username, String password, String email, String gender, int age) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.gender = gender;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
public class A21 {
    public static void main(String[] args) {
        // 测试无参构造方法
        User user1 = new User();
        user1.setUsername("张三");
        user1.setPassword("123456");
        user1.setEmail("zhangsan@example.com");
        user1.setGender("男");
        user1.setAge(25);
        System.out.println(user1.getUsername());
        System.out.println(user1.getPassword());
        System.out.println(user1.getEmail());
        System.out.println(user1.getGender());
        System.out.println(user1.getAge());
        // 测试有参构造方法
        User user2 = new User("张三", "123456", "zhangsan@example.com", "男", 25);
        System.out.println(user2.getUsername());
        System.out.println(user2.getPassword());
        System.out.println(user2.getEmail());
        System.out.println(user2.getGender());
        System.out.println(user2.getAge());
    }

}
